import tool from '@/utils/tool';

export function permission(code) {
	let permissions = tool.data.get("PERMISSIONS");
	if(!permissions){
		return false;
	}
	code = code+ '';	
	let isHave = permissions.includes(code);
	return isHave;
}

export function rolePermission(data) {
	let authInfo = tool.data.get("AUTH_INFO");
	if(!authInfo){
		return false;
	}
	let role = authInfo.role;
	if(!role){
		return false;
	}
	let isHave = role.includes(data);
	return isHave;
}
